/*
Author: Oliver A. Nina
Copyrights: This code is open source. You can use the code for personal or comercial purposes. 
Disclaimer: Code AS IS. There is no warranty on using this code. Use this code at your own discretion.
If you use this code please cite the paper at : Interactive Enhancement on Handwritten Text trough Multi-resolution Gaussian, ICFHR, Bari, Italy 2012
*/

#include "cv.h"
#include "cxcore.h"

class TextEnhancer{
public:
	IplImage * image;
	IplImage * rimage ;
	IplImage * dimage;
	IplImage * map;
	IplImage * roi;
	IplImage * sroi;
	IplImage * bilateral_image;
	
	double kernelRadius;
	double ** kernelD;
	double *gaussSimilarity;
	int stroke_width;
	int kernel_size_increment;
	int cursor_width;
	int enhancement_value;
	TextEnhancer(IplImage *image,int strokeWidth,int kernel_size_increment, int enhancement_value, int cursor_width);
	void apply(int i,int j);
	void apply_around(int x,int y);
	void apply_enhancement_around(int x, int y,int strokeWidth);
	bool is_inside_boundaries(int m,int n);
	double get_spatial_weight(int m, int n,int i,int j);
	int max(int num1, int num2);
	int get_value(IplImage * image,int i,int j);
};
